package org.spring.samples.mvc.simple;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class SimpleController {

	@RequestMapping(value = "/simple")
	//This annotation can be put on a method and indicates that the return type should be written straight to the HTTP 
	//response body (and not placed in a Model, or interpreted as a view name)
	@ResponseBody
	public String simple(Model model) {
		
		return "Hello world!";
//		model.addAttribute("message", "Maven Web Project + Spring 3 MVC - welcome()");
		
		//Spring uses InternalResourceViewResolver and return back index.jsp
		//return "index";
	}
	
	

}
